﻿using System;
using Pro.Common.IoC;

namespace Pro
{
    [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
    public class DependencyAttribute : Attribute
    {
        public DependencyAttribute(Type serviceType,
            ComponentInstanceScope componentInstanceScope = ComponentInstanceScope.PerRequest)
        {
            ServiceType = serviceType;
            ComponentInstanceScope = componentInstanceScope;
        }

        public DependencyAttribute(Type serviceType, string key, ComponentInstanceScope componentInstanceScope,
            int priority)
        {
            ServiceType = serviceType;
            Key = key;
            ComponentInstanceScope = componentInstanceScope;
            Priority = priority;
        }

        public Type ServiceType { get; protected set; }

        public string Key { get; protected set; }

        public int Priority { get; protected set; }

        public ComponentInstanceScope ComponentInstanceScope { get; protected set; }
    }
}